package top.zhangjianyong.tools.factory;

import org.springframework.beans.BeanUtils;
import top.zhangjianyong.tools.entity.RemindItem;
import top.zhangjianyong.tools.parm.RemindItemAddParam;
import top.zhangjianyong.tools.parm.RemindItemUpdateParam;
import top.zhangjianyong.tools.utils.UUIDUtil;

/**
 * @author ： zhangjianyong
 * @date ： 2022/5/12 8:48 AM
 */
public class RemindItemFactory {

    public static RemindItem create() {
        return new RemindItem();
    }

    public static RemindItem create(RemindItemAddParam remindItemAddParam) {
        RemindItem remindItem = create();
        BeanUtils.copyProperties(remindItemAddParam, remindItem);
        remindItem.setUuid(UUIDUtil.uuid());
        return remindItem;
    }

    public static RemindItem create(RemindItemUpdateParam remindItemUpdateParam) {
        RemindItem remindItem = create();
        BeanUtils.copyProperties(remindItemUpdateParam, remindItem);
        return remindItem;
    }
}
